{extend name="common@base" /}
{block name="content"}
<style>
  input[type=number] {
    width: 70px;
  }
</style>
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <form action="" method="post">
        <div class="box box-primary">
          <div class="box-header with-border">
            <div class="box-title">公告管理</div>
            <div class="pull-right">
              <a href="{:url('edit')}" class="btn btn-primary">新增</a>
            </div>
          </div>
          <div class="box-body">
            <table id="table" class="table">
              <thead>
              <tr>
                <th>ID</th>
                <th>标题</th>
                <th>创建时间</th>
                <th>创建人</th>
                <th>排序
                  <button class="btn btn-primary btn-xs js-ajax-submit"
                          data-toggle="tooltip" data-placement="top"
                          title="数字越大，越靠前">保存排序</button>
                </th>
                <th>操作</th>
              </tr>
              </thead>
              <tbody>
              {foreach $rows as $row}
              <tr>
                <td>{$row.id}</td>
                <td><a href="{:url('portal/notice/view',['id'=>$row.id])}" target="_blank">{$row.title}</a></td>
                <td>{$row.create_time}</td>
                <td>{$row.realname}</td>
                <td>
                  <label for="">
                    {:form_dropdown('sort['.$row['id'].']',range(0,5),$row.sort,'class="form-control"')}
                  </label>
                </td>
                <td>
                  <a href="{:url('edit',['id'=>$row.id])}" class="btn btn-xs btn-default">编辑</a>
                  <a href="{:url('delete',['id'=>$row.id])}" class="btn btn-xs btn-danger js-confirm">删除</a>
                </td>
              </tr>
              {/foreach}
              </tbody>

            </table>
          </div>
          <div class="box-footer">
            {$rows->render()}
          </div>
        </div>
      </form>
    </div>
  </div>
</section>
{/block}
{block name="page_script"}
<script>
  require(["layer_config", "ajaxForm"], function (layer) {
    //$('button').tooltip()
  });
</script>
{/block}





